/*
 * scheduler.h
 */


// Prevents multiple definitions in header files
#ifndef _SCHED
#define _SCHED


// Handle BRAIN10 program line
void handleLine(int lineNum, char line[50], int numChars, BRAIN10 *brain10, VBRAIN10 *vbrain10);


// Handle BRAIN10 process data
void handleData(int dataLine, char line[50], BRAIN10 *brain10);


// Prints virutal memory
void printMem(VBRAIN10 *vbrain10);


// Fires up the scheduler.
// Scheduling based on (time slices)
// timeSlice --> n:
//     - n instructions per process
//     - runs until all instructions
//       have been executed
//     - Starts at P0 and makes its way along
void beginScheduling(BRAIN10 *brain10, VBRAIN10 *vbrain10, MAILMAN *mailman, SEMAPHORES *semaphores);


// Returns the number of instructions left to execute
int instLeft(int numProcesses, int instArray[]);

#endif
